import config from '../config'

const goods =(params, success, fail)=> {
  dd.httpRequest({

    url: config.domain + '/goods/page',
    headers: {
      "Content-Type": "application/json"
    },
    method: 'POST',
    dataType: 'json',
    data: JSON.stringify(params),

    success: (res) => {
      if (res.data.code == 0) {
        success && success(res)
      } else {
        fail && fail(res.data.message)
      }
    },

    fail: () => {
      fail && fail('网络异常')
    }
  });
}

module.exports = {
  goods
}